﻿@model Jb.Web.ViewModels.JobFeedViewModel
@using Jb.Common.Extensions

@{
    Layout = null;
    Response.ContentType = "text/xml";
}
@if (Model == null || Model.FoundJobs == null || Model.FoundJobs.Count == 0)
{
    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>@ConfigReader.SiteName</title>
            <link>@WebUtil.GetDomainAddress()</link>
            <description>Jobs From @ConfigReader.SiteName</description>
            <total_jobs>@Model.TotalJobs</total_jobs>
            <page_no>@Model.PageNo</page_no>
            <page_size>@Model.PageSize</page_size>
            @if (Model.FromDate > DateTime.Now.SqlDateTimeMinValue() && Model.ToDate > DateTime.Now.SqlDateTimeMinValue())
            {
            <from_date>@Model.FromDate.ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY)</from_date>
            <to_date>@Model.FromDate.ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY)</to_date>
            }
            <item>No Jobs Found</item>
        </channel>
    </rss>
}
else
{
    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>@ConfigReader.SiteName</title>
            <link>@WebUtil.GetDomainAddress()</link>
            <description>Jobs From @ConfigReader.SiteName</description>
            <total_jobs>@Model.TotalJobs</total_jobs>
            <page_no>@Model.PageNo</page_no>
            <page_size>@Model.PageSize</page_size>
            @if (Model.FromDate > DateTime.Now.SqlDateTimeMinValue() && Model.ToDate > DateTime.Now.SqlDateTimeMinValue())
            {
            <from_date>@Model.FromDate.ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY)</from_date>
            <to_date>@Model.FromDate.ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY)</to_date>
            }
            @*<dc:language>en-gb</dc:language>
            <dc:creator>email</dc:creator>
            <dc:rights>Copyright @DateTime.Now.Year @ConfigReader.SiteName</dc:rights>
            <admin:generatorAgent rdf:resource="http://www.styledna.net/" />*@
            @foreach (var _Job in Model.FoundJobs)
            {
                <item>
                    <title>@_Job.Title</title>
                    <link>@Url.JobDetailsUrl(_Job.ID, _Job.Url, null, true)</link>
                    <description>@_Job.Description</description>
                    <job_id>@_Job.ID</job_id>
                    <job_location>@_Job.JobLocation</job_location>
                </item>
            }
        </channel>
    </rss>
}


